<?php

$country = '';
$IP = $_SERVER['REMOTE_ADDR'];

if (!empty($IP)) {
$ip_country = file_get_contents('http://api.hostip.info/country.php?ip='.$IP);
}
if($country == 'US'){
	$ip_country = 1;
	} 
	else if($country == 'US'){
		$ip_country = 2;
	}
	else if($country == 'AF'){
		$ip_country = 3;
	}
	else if($country == 'AL'){
		$ip_country = 4;
	}
	else if($country == 'DZ'){
		$ip_country = 5;
	}
	else if($country == 'DS'){
		$ip_country = 6;
	}
	else if($country == 'AD'){
		$ip_country = 7;
	}
	else if($country == 'AO'){
		$ip_country = 8;
	}
	else if($country == 'AI'){
		$ip_country = 9;
	}
	else if($country == 'AQ'){
		$ip_country = 10;
	}
	else if($country == 'AG'){
		$ip_country = 11;
	}
	else if($country == 'AR'){
		$ip_country = 12;
	}
	else if($country == 'AM'){
		$ip_country = 13;
	}
	else if($country == 'AW'){
		$ip_country = 14;
	}
	else if($country == 'AU'){
		$ip_country = 15;
	}
	else if($country == 'AT'){
		$ip_country = 16;
	}
	else if($country == 'AZ'){
		$ip_country = 17;
	}
	else if($country == 'BS'){
		$ip_country = 18;
	}
	else if($country == 'BH'){
		$ip_country = 19;
	}
	else if($country == 'BD'){
		$ip_country = 20;
	}
	else if($country == 'BB'){
		$ip_country = 21;
	}
	else if($country == 'BY'){
		$ip_country = 22;
	}
	else if($country == 'BE'){
		$ip_country = 23;
	}
	else if($country == 'BZ'){
		$ip_country = 24;
	}
	else if($country == 'BJ'){
		$ip_country = 25;
	}
	else if($country == 'BM'){
		$ip_country = 26;
	}
	else if($country == 'BT'){
		$ip_country = 27;
	}
	else if($country == 'BO'){
		$ip_country = 28;
	}
	else if($country == 'BA'){
		$ip_country = 29;
	}
	else if($country == 'BW'){
		$ip_country = 30;
	}
	else if($country == 'BV'){
		$ip_country = 31;
	}
	else if($country == 'BR'){
		$ip_country = 32;
	}
	else if($country == 'IO'){
		$ip_country = 33;
	}
	else if($country == 'BN'){
		$ip_country = 34;
	}
	else if($country == 'BG'){
		$ip_country = 35;
	}
	else if($country == 'BF'){
		$ip_country = 36;
	}
	else if($country == 'BI'){
		$ip_country = 37;
	}
	else if($country == 'KH'){
		$ip_country = 38;
	}
	else if($country == 'CM'){
		$ip_country = 39;
	}
	else if($country == 'CV'){
		$ip_country = 40;
	}
	else if($country == 'KY'){
		$ip_country = 41;
	}
	else if($country == 'CF'){
		$ip_country = 42;
	}
	else if($country == 'TD'){
		$ip_country = 43;
	}
	else if($country == 'CL'){
		$ip_country = 44;
	}
	else if($country == 'CN'){
		$ip_country = 45;
	}
	else if($country == 'CX'){
		$ip_country = 46;
	}
	else if($country == 'CC'){
		$ip_country = 47;
	}
	else if($country == 'CO'){
		$ip_country = 48;
	}
	else if($country == 'KM'){
		$ip_country = 49;
	}
	else if($country == 'CG'){
		$ip_country = 50;
	}
	else
	{
	$ip_country = 38;
	}

?>